package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;

@Entity
public class Follow {
    private long followId;
    private Date followDate;
    private String followDemand;
    private String followStage;
    private Sales sales;
    private Employee employee;
    private Customer customerByCustomerId;

    @ManyToOne
    @JoinColumn(name = "YG_ID", referencedColumnName = "YG_ID")
    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    @ManyToOne
    @JoinColumn(name = "SALES_ID2", referencedColumnName = "SALES_ID2")
    public Sales getSales() {
        return sales;
    }

    public void setSales(Sales sales) {
        this.sales = sales;
    }

    @Id
    @Column(name = "follow_id")
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "crm",
            initialValue  =  1,allocationSize  =  1)
    public long getFollowId() {
        return followId;
    }

    public void setFollowId(long followId) {
        this.followId = followId;
    }

    @Basic
    @Column(name = "follow_date")
    public Date getFollowDate() {
        return followDate;
    }

    public void setFollowDate(Date followDate) {
        this.followDate = followDate;
    }

    @Basic
    @Column(name = "follow_demand")
    public String getFollowDemand() {
        return followDemand;
    }

    public void setFollowDemand(String followDemand) {
        this.followDemand = followDemand;
    }

    @Basic
    @Column(name = "follow_stage")
    public String getFollowStage() {
        return followStage;
    }

    public void setFollowStage(String followStage) {
        this.followStage = followStage;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }
}
